package com.yuyu.service.impl;

import com.yuyu.bean.Order;
import com.yuyu.mapper.OrderMapper;
import com.yuyu.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("orderService")
@Transactional
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

    @Override
    public Order findOrderById(Integer id) {
        return orderMapper.findOrderById(id);
    }

    @Override
    public int addOrder(Order order) {
        return orderMapper.addOrder(order);
    }

    @Override
    public int deleteOrder(List<Integer> list) {
        return orderMapper.deleteOrder(list);
    }

    @Override
    public Integer getLastId() {
        return orderMapper.getLastId();
    }

    @Override
    public int editOrder(Order order) {
        return orderMapper.editOrder(order);
    }
}
